import {Component} from '@angular/core';
import {Router} from '@angular/router';
import {HttpClient} from '@angular/common/http';

@Component({
  selector: 'app-generate-discuss',
  templateUrl: './generate-discuss.component.html',
  styleUrls: ['./generate-discuss.component.css']
})
export class GenerateDiscussComponent {
  title: any;
  text: any;

  constructor(private router: Router, private http: HttpClient) { }

  ngOnInit(): void {
  }

  public generateDisscuss(): void{
    const url = '/api/discuss';
    this.http.put(url, {
      title: this.title,
      text: this.text
    },{
      headers: {
        token: localStorage.getItem('token')
      }
    }).subscribe((resp:any)=>{
      if(resp.code == 200){

      }
    })
  }
}
